﻿@using System.Web.Mvc;

<ul class="nav pull-right">
    <li class="divider-vertical"></li>
    @if (WorkContext.CurrentUser != null) {
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            @WorkContext.CurrentUser.UserName
            <b class="caret"></b>
        </a>
        <ul class="dropdown-menu">
            <li>
                @Html.ActionLink( "Change Password" , "ChangePassword", new RouteValueDictionary() { {"Controller","Account"}, {"Area","Orchard.Users" } })
            </li>
            <li>
                @Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = "/" }, new { rel = "nofollow" })            
            </li>
            @if (AuthorizedFor(Orchard.Security.StandardPermissions.AccessAdminPanel)) {
            <li>
                @Html.ActionLink(T("Dashboard").ToString(), "Index", new {Area = "Dashboard", Controller = "Admin"})
            </li>
            }
        </ul>
    </li>
        
    } else {
    <li>
        @Html.ActionLink(T("Sign In").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = (Request.QueryString["ReturnUrl"] ?? Request.RawUrl) }, new { rel = "nofollow" })
    </li>
        
    }
</ul>